package org.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import org.example.JavaBean.plus.Dept;
import org.example.JavaBean.plus.Emp;

import java.util.List;

/**
 * @Auther:Liu
 * @Testname:EmpMapper
 * @Date:2025/8/4 9:36
 */
@Mapper
public interface EmpMapper extends BaseMapper<Emp> {
    @Select("select * from emp where state=1")
    @Results(value = {
            @Result(property = "empno",column = "empno",id = true),
            @Result(property = "ename",column = "ename"),
            @Result(property = "dept",javaType = Dept.class,column = "deptno",
            one = @One(select = "org.example.mapper.DeptMapper.findById"))
    })
    List<Emp> findAll();
}
